package com.fujitsu.cn.fnst.service;

import java.text.ParseException;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fujitsu.cn.fnst.dao.MeetingBookDao;
import com.fujitsu.cn.fnst.entiy.MeetingBook;
import com.fujitsu.cn.fnst.model.MeetingModel;

@Transactional
@Service
public class MeetingBookService implements BaseService<MeetingBook> {
    @Resource
    private MeetingBookDao meetingBookDao;

    @Override
    public MeetingBook find(int id) {

        return meetingBookDao.query(MeetingBook.class, id);
    }

    @Override
    public MeetingBook modify(MeetingBook t) {
        return meetingBookDao.update(t);
    }

    @Override
    public void delete(MeetingBook t) {
        meetingBookDao.delete(t);
    }

    @Override
    public MeetingBook add(MeetingBook t) {
        return meetingBookDao.insert(t);
    }

    @Override
    public List<MeetingBook> find(String queryString) {
        return meetingBookDao.query(queryString);
    }

    public List<MeetingModel> getMeetingState(String where, String order) {
        return meetingBookDao.getMeetingState(where, order);
    }

    public MeetingModel getMeetingState(int meetingId) {
        return meetingBookDao.getMeetingState(meetingId);
    }

    public String timeModel(String date, String beginTime, String endTime,
            String amount) throws ParseException {

        return meetingBookDao.timeModel(date, beginTime, endTime, amount);
    }

}
